import express from 'express'
import {
    getAllUsers,
    getUserById,
    createUser,
    updateUser,
    deleteUser,
    deleteMultipleUsers
} from '../controllers/userController.js'

const router = express.Router()

// 用户 CRUD 路由
router.get('/', getAllUsers)           // GET /users - 获取所有用户
router.get('/:id', getUserById)        // GET /users/:id - 获取单个用户
router.post('/', createUser)           // POST /users - 创建用户
router.put('/:id', updateUser)         // PUT /users/:id - 更新用户
router.delete('/:id', deleteUser)      // DELETE /users/:id - 删除用户
router.delete('/', deleteMultipleUsers) // DELETE /users - 批量删除用户

export default router
